Echo cancellation

ABSTRACT

The present invention relates to a cancellation of echoes in telecommunications systems, more specifically it relates to adaptive alignment of a linear filter ( 500 ) used for echo cancellation. According to the invention, it is continuously determined, by means of control logic ( 520 ), if a reflection replica delay included in an echo replica signal (110), which delay is provided by a signal buffer ( 510 ), should be attempted to be increased or not. Similarly, it is continuously determined if the reflection replica delay should be attempted to be decreased or not. In this way it is possible to provide a delay of the reflection replica which corresponds to the pure delay of a corresponding reflection included in an echo signal (120) received over an echo path. The invention is advantageous since the filter ( 500 ) will continuously and quickly adapt to changes in the echo path delay by continuously increasing or decreasing, in an incremental and smooth manner, a present replica delay.

TECHNICAL FIELD OF THE INVENTION

The present invention generally relates to cancellation of echoes intelecommunications systems, more specifically it relates to adaptivealignment of linear filters used for echo cancellation.

TECHNICAL BACKGROUND AND PRIOR ART

Speech quality is an important factor for telephony system suppliers.The demand from the customers makes it vital to strive for continuousimprovements of the systems. An echo, which is a delayed version of whatwas originally transmitted, is regarded as a severe distraction to thespeaker if the delay is long. For short round trip delays of less thanapproximately 20 ms, the speaker will not be able to distinguish theecho from the side tone in the handset. However, for long-distancecommunications, such as satellite communications, a remotely generatedecho signal often has a substantial delay. Moreover, the speech andchannel coding compulsory in digital radio communications systems andfor telephony over the Internet protocol (IP telephony, for short) alsoresult in significant delays which makes the echoes generated arelatively short distance away clearly audible to the speaker. Hence,canceling the echo is essential in order to maintain the speech quality.

There are different types of echoes that occur in a telephony system.One type is network echo that origins from impedance mismatch in hybridcircuits employed in the public switched telephony network (PSTN).Hybrids are used in order to connect between the two-wire link andfour-wire link in the PSTN system. Since it is practically impossibleto-perfectly tune the hybrids, the impedance mismatch will result inthat some of the incoming speech is reflected back to the talker as adelayed and distorted version of the original speech. The reflectedspeech is denoted network echo. The occurrence of network echo isillustrated in FIGS. 1 and 2.

Another type of echo is echo originating from the use of hands freeequipment with external loudspeaker(s) and microphone(s), so calledacoustic echo. This type of echo has the property that the echo pathchanges continuously due to changes of the environment. The persontalking on the phone may most likely change position as least to someextent during the call. The echo path is also highly non-linear, due tothe characteristics of the room and the equipment, such as theloudspeakers. The occurrence of acoustic echo is illustrated in FIG. 3.

With the introduction of end-to-end IP telephony, the hybrids in theswitches, introducing the network echo, disappear. It can be expectedthat it will take a considerable time until all telephones are replacedby IP telephones, if ever. Until then it will be necessary to have echocancellers removing the network echo generated in the PSTN network.Furthermore, as long as digital radio communications networks areinterconnected with PSTN networks, echoes generated in the PSTN networkwill have to be removed. Also, the acoustic echo will always remain, dueto its physical connection.

An echo canceller typically includes a linear filtering part whichessentially is an adaptive filter that tries to adapt to the echo path.In this way a replica of the echo can be produced that can be removedfrom the received signal originating from the end at which the echosource is located, thereby canceling the echo. The filter generating theecho replica has a finite or infinite impulse response. Most common itis an adaptive, linear finite impulse response filter (FIR) with anumber of delay lines and a corresponding number of coefficients, orfilter delay taps. The coefficients are values, which when multipliedwith delayed versions of the filter input signal, generate an estimateof the echo. The filter is adapted, i.e. updated, so that thecoefficients converge to optimum values. The traditional way to cancelout the echo is to update a finite impulse response (FIR) filter usingthe normalized least mean square (NLMS) algorithm, although a variety ofalternative algorithms exist.

A problem arises from the fact that an entire echo path responseincludes one part due to signal propagation time, speech and channelcoding etc., forming a pure delay, and one part due to the actual echosource. Thus, if the echo replica filter were to model the entireimpulse response of the echo path, a great number of coefficients wouldbe needed in order to also handle the included pure delay. This in turnwould put very high, and often unrealistic, requirements on memory andcomputation capabilities for implementing the filter and its operation.Also, the coefficients of such a filter would converge much slower totheir optimum values.

Thus, during echo cancellation it is desired that the echo cancellerestimates the pure delay of the entire impulse response of the echo pathin such way that the filter coefficients are adapted to the part of theentire echo that originates from the actual echo source. This proceduremay be described as a time alignment of the filter to the echo source.In this way the number of coefficients of the filter can be kept to areasonable and practicable level.

U.S. Pat. No. 4,582,963 discloses a method for echo canceling in which abulk delay is provided separately from adaptive filter delays. Differentmethods for selecting a suitable bulk delay are described. One method isto detect how long it takes for an echo of a signal transmitted on thereceive line of the echo source to occur on the transmit line of theecho source. A number of estimates of the bulk delay is provided and theselected bulk delay is given by the estimate which is most closelyclustered with the other estimates. Another method is to iterativelyincrement the bulk delay, wherein each delay value is combined with thefilter to give a measure of adaptation. The bulk delay is then chosen asthe delay for which the measure of adaptation approaches a peak value.

U.S. Pat. No. 5,920,548 discloses the configuration of an adaptivefilter in such way that only a range of filter taps between two tapendpoints is involved in the echo cancellation operation. All taps lessthan a first boundary tap serve as a buffer during the echo cancellationoperation. The first boundary tap is selected as the tap being a certainnumber of taps less than a located tap that has a value withpredetermined factor greater than a certain predetermined value.

SUMMARY OF THE INVENTION

An object of the present invention is to provide a method and anapparatus that continuously, with low numerical complexity, monitors thepure delay of a reflection included in an echo signal, and adapts theuse of linear filter coefficients in accordance with this pure delaywhen canceling the echo.

According to the present invention, this and other objects are achievedby a method of an echo canceller according to claim 1, acomputer-readable medium according to claim 18, an echo cancelleraccording to claim 19, a system apparatus according to claim 30 and useof an echo canceller according to claim 31, which claims representdifferent aspects of the invention.

According to the invention, it is continuously determined if areflection replica delay included in an echo replica signal, which delayis provided by a signal buffer, should be attempted to be increased ornot, as well as being continuously determined if the reflection replicadelay should be attempted to be decreased or not, in order to provide adelay of the reflection replica which corresponds to the pure delay of acorresponding reflection included in an echo-signal received over anecho path.

By continuously monitoring the echo reflection delay and determining ifthe replica delay should be increased or not, or decreased or not, andif so increasing or decreasing the present replica delay, thecoefficients of the linear filter is used in an efficient way and thenumber of needed coefficients, and hence required memory, is reduced.Furthermore, with this operation the time of convergence for the filterand its coefficients will be reduced.

The echo path of an echo may vary during a telephone call, for exampledue to a call transfer. Also, the echo source itself may vary during acall. For example due to a change of phone device during the call, athird party connecting to the call, variations of the hybrid in thedevice used (e.g. affected by temperature) and so on. During acousticecho the echo will be affected by movement of the device in a room andchanges in the distance between a loudspeaker and a microphone of thedevice etc.

Also, if PC based terminals are used, the echo may also be affected by aclock drift in A/D and D/A devices primarily used by PC soundcards, orby telephony application delays in a PC environment if the applicationis not allocated enough processor time due to the higher priority givento other applications running in the same PC environment.

The invention is advantageous since the filter will continuously andquickly adapt to changes in the echo path, or changes of the echo causedby the echo source or its environment, by continuously increasing ordecreasing, in an incremental and smooth manner, a present replicadelay. This smooth delay adjustment, or re-alignment of the filter, alsohas the advantage that distortions of the generated echo replica due tore-alignments are minimized. Thus, the time of convergence of the filtercoefficients during a re-alignment of the filter due to changes of theecho delay will be performed with extreme efficiency, while at the sametime minimizing any distortions due to the re-alignment. Also, theinvention performs the delay adjustments without having to monitor anexcess number of filter coefficients, thus keeping the numericalcomplexity low.

Another advantage with the invention is that the continuously monitoringenables the echo cancellation process of the invention to better copewith echoes where the high energy levels are concentrated to severalseparated parts, thus forming several separated energy concentrations.These separated energy concentration may be the result of thecharacteristics of the echo source or of a distributed echo path inwhich the echo originates from multiple reflections. The inventionenables the coefficients of the filter to cover the major part where theenergy of the echo response is concentrated by adapting the buffer delayused for estimating the pure delay during echo cancellation in such waythat the filter delay taps cover these parts in a more favorable way.

For example, with two separated energy concentration parts in the echoimpulse response, the delay may be tuned in such way that the filtercoefficients corresponding to long delays will cover a second part ofthe echo signal with high energy levels, while the filter taps providingshort delays will cover as much energy as possible of a first part ofthe echo signal with high energy levels, thus leaving out the verybeginning of the first part from the filter.

According to an embodiment of the invention, the echo cancellation isbased on two or more linear filters, each filter generating a replica ofa corresponding reflection energy concentration included in an echobased on a corresponding delayed input signal from a buffer. Thus, thedifferent filters of the echo canceller are adapted to the differentdelays of different energy concentrations of a reflection. In this waythe invention enables an even more improved cancellation of echoes thatinclude two or more separated energy concentrations.

According to another embodiment, the basis for increasing the replicadelay provided by the buffer is a relationship between the energy,measured as sum-squares of filter coefficients, of the beginning of thefilter associated with short delays and the energy of the full lengthfilter, i.e. the estimated echo return loss. If the energy measured inthe beginning of the filter is low, the delay is increased.Correspondingly, if the energy measured for the coefficients of thetailing part of the filter is low in comparison with the energy of thefull length filter, the delay is decreased. By measuring the beginningand tailing part, e.g. the first and the last quarter, respectively, ofthe filter coefficients, rather than for example the early half and latehalf, respectively, the alignment process of the invention achieves animproved resolution. Furthermore, the alignment process of the inventionwill, before re-alignment, know how much energy that will be lost if anincrease/decrease operation excludes a beginning/tailing part of thecoefficients from the echo replica. If this energy to be excluded isconsidered to be to high, the filter is simply not re-aligned. This alsoprovides an improved way of controlling the re-alignment process, ascompared to if this process were to be based on, for example, maximumcorrelation measurements between the echo replica and the true echoimpulse response.

Yet another advantage is that the operation of the echo canceller inaccordance with the invention does not require any searches for functionmaxima or correlation calculations during alignment and re-alignment ofthe filter coefficients.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1 and 2 illustrate the occurrence of network echo;

FIG. 3 illustrates the occurrence of acoustic echo;

FIG. 4 shows a typical known echo canceller forming the basis for anexemplifying embodiment of the present invention;

FIG. 5 shows a schematic view of an echo canceller in accordance with anembodiment of the invention;

FIG. 6 shows a state diagram illustrating the overall operation ofcontrolling a delay when canceling an echo in accordance with anembodiment of the invention;

FIGS. 7 and 8 illustrate exemplifying positionings of a linear filterand its coefficients after having been aligned to an echo impulseresponse in accordance with the invention;

FIG. 9 shows a linear filter with finite impulse response whichexemplifies the filter indicated in FIG. 5;

FIGS. 10, 11 and 12 illustrate an exemplifying decision logic realizingthe state diagram shown in FIG. 6; and

FIG. 13 shows an embodiment of the invention in which multiple shortlinear filters are employed.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIGS. 1-3 exemplify different types of echoes which advantageously arecancelled by the present invention.

FIGS. 1 and 2 illustrates the occurrence of network echo. FIG. 1 showsthe echo originating from a hybrid to which a subscriber by means of a2-wire line is connected, i.e. the echo from the Public SwitchedTelephone Network (PSTN) line interface to which the subscriber isconnected. FIG. 2 shows two PSTN phones interconnected via one or morenetworks, such as via satellite transmission paths, an IP network or aradio network. The signal from subscriber A is partly reflected atHybrid B and returned to subscriber A as a network echo. Subscriber Awould also receive a network echo if he were to be directly connected toa IP network or a radio network, such as a digital cellularcommunications network.

FIG. 3 shows the occurrence of acoustic echo due to cross talk between aloudspeaker and a microphone of a handset or a hands free equipment.

FIG. 4 shows a typical known echo canceller which general structure andoperation also form the basis for an exemplifying embodiment of thepresent invention.

With reference to FIG. 4, the echo canceller consists of a linearfiltering part 100 and a non-linear part 200. A far end signal 190generated at the far end and transmitted to the near end is input to thefiltering part 100. The filtering part 100 is essentially an adaptivefilter that tries to adapt to the echo path. In this way a replica 110of the echo 140 can be produced, which can be removed from the returningsignal 120. The echo canceller also includes a control unit 230, whichsupervises the update of the linear filter 100, the actions of thenon-linear part 200 and an artificial noise generator 220.

The filtering part 100 is not able to describe the characteristics ofthe hybrid 210 perfectly, even when well converged. Thus, there will besome remaining echo after the filtering part included in the signaldenoted 130. Even when the attenuation of the echo is high, for example25 decibels, the echo will be audible to the far end speaker. In orderto deal with this, the non-linear part 200, implemented as a non-linearprocessor (NLP), is designed to remove the remainder echo. Accordingly,the NLP should detect and remove the remaining echo in the signal 130when the residual echo is audible. The residual echo is given by thedifference between the echo 140 from the hybrid and the echo replica110. Of course, the NLP shall not affect the near end signal 170,originating from a near end speaker, that has to be transmitted withoutdistortion through the NLP 200. An NLP usually estimates correlationbetween different signals, and in this way decision is taken if there isany echo to remove.

In a simplified description the NLP may be a center clipper which simplycuts the low energy residual echo. Thus, after the remaining echo hasbeen removed by the NLP, there will be sections of silence in theremaining signal 150. For this reason artificial noise 160, resemblingthe background noise of signal 170 from the near end, is constructed andinserted by an artificial noise generator 220 into the silent periods ofsignal 150. The resulting signal 180 is then, under the assumption thatthe injected noise 160 has the same characteristics as the realbackground noise of signal 170, supposed to sound well.

The control unit 230 supervises the actions of the filter update scheme,the NLP and the artificial noise injection. It hence has a significantimpact of the overall performance of the echo canceller. Regardless ofwhat underlying filter updating scheme that is chosen, the control logicdecides when to permit update of the filter parameters in filter 100.The signals that are known to the control unit are, with reference toFIG. 4, the error signal 130, the estimated echo 110, the far end signal190 and the near end returning signal 120 containing the echo signal 140and the near end speech signal 170. From these measurements, the energylevels of the far end and the near end can be estimated. The noise levelin the far end and the near end, respectively, are also needed. It is ofgreat importance that the control unit is able to detect double talk,which is the occurrence of simultaneously speaker activity at both endsof the telephony connection.

Basically the functionality of the control logic is as follows.Adaptation of the linear filter 100 is allowed when all of the followingconditions are fulfilled:

-   -   far end signal 190 has sufficient energy amount; and    -   near end signal 170 is of low level.

Further, adaptation is prohibited when any of the following conditionsare met:

-   -   far end signal 190 is of low level;    -   speech in near end signal 170 is of high level;    -   double talk is present, that is simultaneously speaker activity        by both the far end and near end speaker; or    -   background noise in near end signal 170 is of high level.

With reference to FIG. 5 an schematic view of an echo canceller inaccordance with an embodiment of the invention is shown. The echocanceller includes a linear filter 500, a buffer memory, or signalbuffer 510 and control logic means 520. Any non-linear filtering part orartificial noise generator, or other elements usually present in an echocanceller, are not shown in FIG. 5, but may still be included. Depictedin the figure is also a hybrid 530 generating the echo which is to becancelled.

The control logic means 520 is depicted in FIG. 5 as being connected tothe buffer for the purpose of controlling the delay of a far end signal190 conveyed by the buffer memory 510 to the input of the filter 500 asa delayed signal 195. The control logic means 520 includes first controllogic circuitry and second control circuitry designed partly fordetermining if attempt should be made to increase the delay of thesignal 195 conveyed to the filter 500, partly for controlling the actualoperation of increasing the delay.

Correspondingly, the control logic means 520 also includes secondcontrol logic circuitry designed partly for determining if attemptshould be made to decrease the delay of the signal 195 conveyed to thefilter 500, partly for controlling the actual operation of decreasingthe delay.

Preferably, the first and second control circuitry are designed toattempt to increase and decrease, respectively, the delay when thesignal denoted “error” exceeds a respective predetermined threshold. Asdescribed above this error signals is indicative of a difference betweena received echo signal 120 and the echo replica signal 110 produced bythe filter 500. Alternatively, or in addition, the first and secondcontrol circuitry attempt to increase/decrease the delay at regularintervals defined by one or more included timers.

The first control circuitry includes circuitry means for calculating thesum-squares of a first set of filter coefficients associated with shortdelays, such as the beginning quarter of the coefficients, and relatingthis measure with the calculated sum-squares of a second set ofcoefficients representative of the full filter, typically correspondingto the echo return loss. If this relationship is below a firstpredetermined threshold the delay of the signal 195 input to the filter500 is controlled to be incrementally increased.

Correspondingly, the second control circuitry includes circuitry meansfor calculating the sum-squares of a third set of filter coefficientsassociated with long delays, such as the tailing quarter of thecoefficients, and relating this measure with the calculated echo returnloss. If this relationship is below a second predetermined threshold thedelay of the signal 195 input to the filter 500 is controlled to beincrementally decreased.

It should be understood that the described first and second controlcircuitry suitably are implemented by means of a digital signalprocessor (DSP) or some other suitable processing hardware means, suchas a microprocessor or one or more application specific integratedcircuits, which hardware is designed and configured for execution ofprogram instructions so as to operate in accordance with the method ofthe present invention. Furthermore, the implementation of a linearfilter and buffer memory for delaying a signal to the linear filter bymeans of appropriate memory circuits is well known to the person skilledin the art.

With additional reference to FIG. 6 a state diagram illustrates theoverall operation of controlling the delay of the signal 195 provided tothe input of the filter 500 by the signal buffer 510. The operationcomplies to a state diagram typically having three different states forcontrolling the positioning of the filter, an increase state 600, adecrease state 610 and an idle state 620, wherein each state indicates acorresponding mode of operation. The transitions between the differentstates are determined, in an exemplary embodiment, in accordance withthe flow charts shown in FIG. 10, FIG. 11 and FIG. 12.

As long as the state machine is in the idle mode 620, there are noactions taken to adaptively align the filter. Transitions, or modeswitches, from the idle mode 620 to the increase mode 600 and thedecrease mode 610, respectively, are determined based on timers or ifcertain events are detected. A typical example of such events is anyevent that can be associated with a change of the echo path delay, suchas a detected difference between a received echo signal 120 and thegenerated echo replica signal 110. If an echo path change is detectedthe state machine is reinitialized in accordance with the process shownin FIG. 10. The detection of an echo path change can be implemented as atest in the process of FIG. 10, a test which is incorporated prior tothe counter value test 710. Initially it may be advantageous to forcethe state machine into increase mode in order to speed up the initialbehavior of the echo canceller.

As long as the state machine is in increase mode 600, the control logiccircuitry 520 of the invention tests if the delay of signal 195 can beincreased relative to the far end signal 190. The delay of signal 195relative to far end signal 190 is increased until a maximum pre-setdelay determined by the size of the buffer 510 is reached (set by thescalar MAXDELAY in the test 750 in FIG. 11), or until energy is measuredin the first set of coefficients in the adaptive filter 500 (test 725 inFIG. 11), or until a certain time period has expired (test 710 in FIG.10). According to FIG. 6, the state machine then switches back to idlemode 620.

As long as the state machine is in decrease mode 610, the control logiccircuitry 520 of the invention tests if the delay of signal 195 can bedecreased relative to the far end signal 190. The delay of signal 195relative to far end signal 190 is decreased until a minimum pre-setdelay determined by the size of the buffer 510 is reached (set by thescalar MINDELAY in the test 740 in FIG. 11), or until energy is measuredin the last set of coefficients in the adaptive filter 500 (test 715 inFIG. 11), or until a certain time period has expired (test 710 in FIG.10). According to FIG. 6, the state machine then switches to idle mode620.

Clearly, the scalar MINDELAY representing the minimum delay of signal195 relative to the far end signal 190 is greater than or equal to zero.The scalar MAXDELAY is greater than MINDELAY, and typically correspondsto a delay of the order 64 to 256 ms.

To allow faster time tracking of the true delay it may be advantageousto let the thresholds of the timers be reduced if the magnitude or thepower of residual error exceeds a certain threshold. For example, suchtest can be placed prior to test 760 in FIG. 12. If the test ispositive, that is the magnitude of the residual error exceeds a certainthreshold, then VALUE4 is reduced by half. After proper alignment of thefiler, VALUE 4 is reset to its initial value. If this measure of theresidual error exceeds a higher threshold it may be taken as a suddenchange of echo path. The echo canceller is then re-initialized, i.e. theprocess again starts at step 700 in FIG. 10.

Referring again to FIG. 5, the echo canceller make use of a calculatedmeasure of the echo return loss (ERL), which describes the attenuationof the echo due to the properties of the hybrid 530. For a far endsignal 190 of level Px in decibels, the level of the echo 140, isroughly given by the difference Px−ERL [dB]. The sum-squared-filtertaps, or coefficients, of the linear filter 500 produces an estimate ofthe ERL.

With reference to FIG. 9, the linear filter to which the delayed signal195 is input is shown in more detail. The design of this filter per seis known to the skilled person. The estimate of the ERL is given by thesum of the squared filter weights h[0], h[1], . . . , i.e. the sumsquares of the filter coefficients. By the linearity of the summationoperator, the estimate of the ERL can be calculated as the sum of threeterms, where:

-   -   The first term is the sum of a first set of squared filter taps.        Below, this first term is denoted SUB_ERL_HEAD.    -   The second term is the sum of a set of squared filter taps in        the middle of the filter.    -   The third term is the sum of a third set of squared filter taps.        Below, this term is denoted SUB_ERL_TAIL.

With the first term being the sum-squared filter taps of the first partof the filter, it corresponds to the energy in the head of the filter,which part is associated with short delays. Accordingly, if the firstterm is close to zero, meaning that the first set of filter weights areall close to zero, it is reasonable to assume that the first part of thefilter (the head) adapts to a pure delay. Thus, test 725 in FIG. 11 canbe formalized according toERL>TRESHOLD1*SUB_ERL_HEADWhere ERL is the estimated echo return loss, THRESHOLD1 is apredetermined threshold value and SUB_ERL_HEAD is the sum of a first setof squared filter coefficients.

Typically, the number of filter taps in the filter 500, depicted in FIG.5 and FIG. 9, is in the range 256 to 1024 (32 to 128 ms at 8 kHzsampling rate), and SUB_ERL_HEAD is calculated based on 32 filter taps(4 ms at 8 kHz sampling rate). THRESHOLD1 is typically 128, meaning thatthe energy in the beginning of the filter is approximately 21 dB belowthe ERL. If the condition above is fulfilled there is no energy in thehead of the filter and one is added the counter COUNTER_INCREASE (Action726 in FIG. 11). If COUNTER_INCREASE has been updated VALUE3 times insequence (test 728 in FIG. 11), the filter is adaptively aligned so thatthe bulk delay determined by the buffer 500 in FIG. 5 is increased bythe same, or a smaller number, number of delays as used for calculationof SUB_ERL_HEAD under the control of the control logic 520. Clearly,there is an upper bound on the maximum allowable delay determined bytest 750.

The filter alignment/re-alignment procedure described above willincrease the delay provided by the buffer until a certain amount ofenergy is detected in the beginning of the filter with respect to theecho return loss. This amount is controlled by the predeterminedthreshold THRESHOLD1, or until a maximum preset delay determined by thescalar MAXDELAY. With reference to FIG. 5, the procedure strives tomaximize the delay in the buffer 510.

For one skilled in the art it is evident that a similar approach can beused in order to decrease the delay for proper re-alignment of thefilter, i.e. by comparing the relationship between the sum-squared tapsof the tailing part of the filter and the ERL with a secondpredetermined threshold (THRESHOLD2). In a preferred embodiment, this isdescribed by tests 715, 717 and 740 in FIG. 11.

Re-alignment of the filter is performed smoothly by delay shifts ofcoefficients in the filter 500. With the vector h indicating the impulseresponse produced by the filter, that ish=[h(0), . . . , h(N-1)]then, a smooth transition for increasing the delay is performed with thefollowing two steps

-   a) downshifting of the impulse response, that is h[1]:=h[1+VALUE],    where VALUE is the introduced delay. This operation is performed for    all integers 1 such that 1=0, . . . , N-VALUE-1.-   b) resetting the N-VALUE last values to zero, that is h[1]:=0.0 for    1=N-VALUE, . . . , N-1.

For the opposite operation, that is in order to decrease the bufferdelay, the two steps of the following scheme are preferred:

-   a) shifting of the impulse response, that is h[1]:=h[1-VALUE], where    VALUE is the value of the reduction of the delay. This operation is    performed for all integers 1 such that 1=N-1, . . . , N-VALUE. Note    here that h[1] is updated for decreasing values of 1.-   b) resetting the N-VALUE first coefficients to zero, that is    h[1]:=0.0 for 1=0, . . . , N-VALUE-1.

With reference to FIGS. 7 and 8, exemplifying positionings of the filtercoefficients, depicted as a “window of the echo canceller” areillustrated after having been aligned to an echo impulse response inaccordance with the invention. In these examples, as indicated in thefigures, the filter has 256 coefficients. Thus making the number ofcoefficients explicitly indicated in the figures merely illustrative.

In FIG. 7 it can be seen that no filter coefficients are associated thepure echo path delay, i.e. the window of the echo canceller does notcover this pure delay, but the pure delay is estimated by the buffer 510in accordance with the scheme of the invention. Indicated in FIG. 7 isalso a set of coefficients in the beginning of the filter, depicted asSUB_ERL_HEAD, and a set of coefficients at the tailing part of thefilter, depicted as SUB3_ERL_TAIL. It is the sum-squares of theseSUB_ERL_HEAD and SUB_ERL_TAIL parts that during the alignment have beenrelated to the coefficients representative of the full filter, i.e. theecho return loss indicated in FIG. 7 as ERL.

In FIG. 8 it can be seen that the filter has been aligned so as to coveran echo impulse response that includes two separated energyconcentrations. It should be noted that in accordance with the scheme ofthe invention, the delay has been increased so as to fully cover thesecond energy concentration, while leaving out the very beginning of theecho impulse response since this part has very low energy levels. Itshould be understood that this example is tailored to clarify theinvention, and the example is of course dependent upon the positioningof the energy concentration in relation to the full length of the filterused.

One skilled in the art may readily appreciate that the scheme of thepresent invention may be employed also for, so called, two path modelsor double filter structures where two filters are employed. In such aset-up a foreground and a background filter, using different controllogic arrangements, models the echo path, thereby making the echocanceller more robust to double talk. The use of such double filterstructures is known to the person skilled in the art.

The complexity of an echo canceller is often directly proportional tothe number of active coefficients of the adaptive filter. The requiredlength (number of coefficients) of the filter depends on the hybrid(hybrids) or room acoustics in the echo path. Preferably, the echocanceller should allow for multiple reflections, in which case one puredelay estimation most often will not be enough since it often will notbe possible to select one pure delay that covers all reflections.

A solution that is attractive in terms of complexity is to use multipleshort filters instead of a longer one. The delay estimation methodoutlined in this application is very useful in such scenarios. Forexample, a filter of length 256 may fail to provide a good results, but2 filters of length 64 may provide a very good result. Thus, similarlyto aligning one filter to handle one pure delay, multiple filters areseparately aligned to handle distributed echo paths where the echooriginates from respective multiple reflection. Such a structure isexemplified in FIG. 13., wherein the far end signal 190 is input to themultiple filters denoted FILTER 1. M and the signal 110 is the generatedecho replica signal. As apparent from the reference signs, FILTER 2 330is also included in the drawing at a greater level of detail in order toexemplify the filters included by the multiple filter structure. In thisrespect, the echo path can be modeled by a first part containing a delayand a reflection, a second part containing another delay and reflection,and so on. Once the first bulk delay and echo path have been identifiedand the filter accordingly has been aligned, the sequential alignmentcan be achieved in a similar vein.

Thus, it is evident that method outlined above can be used to controland align multiple filters as well a single filter. Another example of away to align such filters would be to start with one filter of a maximumlength, as limited by computational power. Then, the delay is increaseduntil a maximum delay is found. The filter is then divided into twoseparate filters, each one using a separate delay estimate andalignment. Typically, the filter is divided in half. If the proposedmethod is used to align also a second filter the estimated associatedsecond delay will be increased until the second reflection is found. Itis necessary to add a condition to prevent overlap of the filters.

Thus, the invention is not only able to handle a static pure delay bybuffering data, it can adaptively increase as well as decrease thebuffer size as well as handle an echo path with separated energyconcentrations and distribute the filter coefficients to cancel adistributed echo.

Even though the invention has been described with reference to specificexemplifying embodiments thereof, many different alterations,modifications and the like will become apparent for those skilled in theart. The described embodiments are therefore not intended to limit thescope of the invention, as it is defined by the appended claims.

1. A method of an echo canceller, which echo canceller includes a linearfilter for generating an echo replica signal from filter coefficients ofdelay taps and an input signal to the filter, the method including thesteps of: a) applying a signal transmitted in the direction of an echosource as input signal to a signal buffer, the signal buffer providing adelayed input signal to the input of the filter, which delayed signalhas a delay that is subject to control by control logic included by theecho canceller, characterized by repeatedly performing the steps of: b)determining, based on a predetermined first mode switch condition,whether or not it should be attempted to increase the delay of the inputsignal to the filter, and if the first mode switch condition is met,entering an increase mode in which, if a ratio between a calculatedmeasure based on a first set of filter coefficients and a calculatedmeasure based on a second set of filter coefficients is below a firstpredetermined threshold, the buffer is controlled to increase the delayof the input signal; and c) determining, based on a predetermined secondmode switch condition, whether or not it should be attempted to decreasethe delay of the input signal to the filter, and if the second modeswitch condition is met, entering a decrease mode in which, if a ratiobetween a calculated measure based on a third set of filter coefficientsand the calculated measure based on the second set of filtercoefficients is below a second predetermined threshold, the buffer iscontrolled to decrease the delay of the input signal.
 2. The method asclaimed in claim 1, wherein the echo canceller includes a second linearfilter for generating a replica of a second energy concentration of areflection from the echo source, which replica of the second reflectionis included in the echo replica signal, said signal buffer providing asecond delayed input signal to the input of the second filter, whichsecond delayed input signal has a second delay which is controlled bymeans of said control logic in accordance with step b) and c), therebygenerating an echo replica signal including two separated energyconcentrations of a reflection.
 3. The method as claimed in claim 2,wherein one or more additional linear filters are included in the echocanceller for generating, based on one or more corresponding additionaldelayed input signals from the signal buffer having delays which arecontrolled in accordance with step b) and c), an echo replica signalincluding one or more corresponding additional energy concentrations ofa reflection.
 4. The method as claimed in claim 1, including basing saidfirst and said second mode switch conditions on events which areassociated with a change of the echo path.
 5. The method as claimed inclaim 1, including defining said first and said second mode switchconditions to be met when a difference between a received echo signaland the echo replica signal produced by the filter exceeds a first errorthreshold.
 6. The method as claimed in claim 1, including defining saidfirst and said second mode switch conditions to be met at certainintervals under the control of one or more timers.
 7. The method asclaimed in claim 1, wherein said first set of filter coefficientsincludes coefficients associated with short delays; said third set offilter coefficients includes coefficients associated with long delays;and said second set of filter coefficients is representative of the fulllength of the filter.
 8. The method as claimed in claim 1, wherein thecalculated measures are energies in the form of sum-squares of therespective sets of filter coefficients.
 9. The method as claimed inclaim 1, wherein said linear filter is a finite impulse response (FIR)filter.
 10. The method as claimed in claim 1, wherein the method isperformed in an end-user equipment for telephony in order to cancelacoustic echo produced by cross-talks between a loudspeaker and amicrophone or by reflections of the surroundings in which the end-userequipment is located.
 11. The method as claimed in claim 1, wherein themethod is performed in a local telephony switch operatively connected toan end-user equipment for telephony.
 12. The method as claimed in claim1, wherein the method is performed in a telephone switch operativelyconnected to a local telephony switch.
 13. The method as claimed inclaim 1, wherein the method is performed in a long distance telephoneswitch operatively connected to a local telephony network, or in agateway employed by such an operative connection.
 14. The method asclaimed in claim 1, wherein the method is performed in a mobilecommunications network, such as in a Mobile Switching Centre,operatively connected to a telephony network, or in a gateway employedby such an operative connection.
 15. The method as claimed in claim 1,wherein the method is performed in an packet switched networkoperatively connected to a telephony network, or in a gateway employedby such an operative connection.
 16. The method as claimed in claim 15,wherein said packet switched network is an Internet Protocol network.17. A computer-readable medium storing computer-executable componentsfor causing an echo canceller, which echo canceller includes at leastone linear filter for generating an echo replica signal and a delaybuffer for conveying a signal transmitted to an echo source as delayedinput signals to each of said at least one linear filter, to perform thesteps recited in of claim 1 when the computer-executable components arerun on general purpose computer included by the echo canceller.
 18. Anecho canceller including a linear filter for generating an echo replicasignal from filter coefficients of delay taps and an input signal to thefilter, the echo canceller further including: a buffer memoryinterconnecting a transmission line for transmitting a signal in thedirection of an echo source and an input of the filter; and controllogic means connected to the buffer memory for controlling the delay ofthe signal conveyed by the buffer memory to the input of the filter,characterized in that the control logic means includes: first controlcircuitry for repeatedly determining, based on a predetermined firstmode switch condition, whether or not it should be attempted to increasethe delay of the input signal to the filter, and if the first modeswitch condition is met, entering an increase mode in which, if a ratiobetween a calculated measure based on a first set of filter coefficientsand a calculated measure based on a second set of filter coefficients isbelow a first predetermined threshold, the buffer is controlled toincrease the delay of the input signal; and second control circuitry forrepeatedly determining, based on a predetermined second mode switchcondition, whether or not it should be attempted to decrease the delayof the input signal to the filter, and if the second mode switchcondition is met, entering a decrease mode in which, if a ratio betweena calculated measure based on a third set of filter coefficients and thecalculated measure based on the second set of filter coefficients isbelow a second predetermined threshold, the buffer is controlled todecrease the delay of the input signal.
 19. The echo canceller asclaimed in claim 18, including a second linear filter for generating areplica of a second energy concentration of a reflection from the echosource, which replica of the second reflection is included in the echoreplica signal, said buffer memory being arranged to convey a seconddelayed input signal to the input of the second filter, which seconddelayed input signal has a second delay which is controlled by means ofsaid first and said second control circuitry, thereby providing an echoreplica signal including two separated energy concentrations of areflection.
 20. The echo canceller as claimed in claim 19, including oneor more additional linear filters for generating, based on one or morecorresponding additional delayed input signals from the buffer memoryhaving delays which are controlled by means of said first and saidsecond control circuitry, an echo replica signal including one or morecorresponding additional energy concentrations of a reflection.
 21. Theecho canceller as claimed in claim 18, wherein said first and secondcontrol circuitry are arranged to base said first and said second modeswitch conditions on events which are associated with a change of theecho path.
 22. The echo canceller as claimed in claim 18, wherein saidfirst and second control circuitry are arranged to determine that saidfirst and said second mode switch conditions are met when a differencebetween a received echo signal and the echo replica signal produced bythe filter exceeds a first error threshold.
 23. The echo canceller asclaimed in claim 18, including one or more timers for controllingintervals, the intervals defining when said first and said second modeswitch conditions are met.
 24. The echo canceller as claimed in claim18, wherein said first set of filter coefficients includes coefficientsassociated with short delays; said third set of filter coefficientsincludes coefficients associated with long delays; and said second setof filter coefficients is representative of the full length of thefilter.
 25. The echo canceller as claimed in claim 18, wherein thecalculated measures are energies in the form of sum-squares of therespective sets of filter coefficients.
 26. The echo canceller asclaimed in claim 18, wherein said linear filter is a finite impulseresponse (FIR) filter.
 27. The echo canceller as claimed in claim 18,wherein the control logic means with its first and second controlcircuitry are implemented by means of a digital signal processor, ageneral purpose microprocessor or one or more application specificintegrated circuits.
 28. A system including of any one of the followingequipments: an end-user equipment for telephony over a circuit switchedor a packet switched network; a local telephony switch operativelyconnected to an end-user equipment for telephony; a telephone switchoperatively connected to a local telephony switch; a Mobile SwitchingCentre of a mobile communications network operatively connected to atelephony network; or a gateway interconnecting either a packet switchednetwork or a mobile communications network with telephony network, andfurther including, as part of the equipment or connected to theequipment, an echo canceller in accordance with claim
 18. 29. A methodfor canceling acoustic echo produced by cross-talks between aloudspeaker and a microphone of an end-user equipment for telephony, orproduced by reflections of the surroundings in which the end-userequipment is located, comprising the step of canceling the echo by meansof an echo canceller as claimed in claim
 18. 30. A method for cancelingan echo signal produced by circuitry in a local telephony switch,comprising the step of canceling the echo signal by means of an echocanceller as claimed in claim 18.